const Sequelize = require('sequelize');
const baseModel = require('../baseModel');

class works_teach extends baseModel{
  constructor(){
    super('works_teach',{
      id:{
        type: Sequelize.INTEGER,
        autoIncrement: true,
        allowNull: false,
        primaryKey:true
      },
      name:{
        type: Sequelize.STRING(20),
        allowNull: false
      },
      // 文件地址
      fileURL:{
        type: Sequelize.STRING,
        allowNull: false
      },
      pageURL:{
        type: Sequelize.STRING,
        allowNull: false
      },
      type: {
        type: Sequelize.STRING(6),
        allowNull: false
      },
      updatedAt:{
        type: Sequelize.DATE,
        allowNull: false
      },
      createdAt:{
        type: Sequelize.DATE,
        allowNull: false
      }
    });
    this.model = super.getModel();
    this.model.sync();
  }
}

module.exports = new works_teach();
